#!/usr/bin/env bash

# generate next version
yarn version patch
#v=`(git describe --abbrev=0 --tags)`
#echo "current:${v}"
#next="${v%.*}.$((${v##*.} + 1))"
next=$(node -p -e "require('./package.json').version")
echo "version:${next}"

# generate release notes
yarn changelog

# commit
git reset
git add package.json
git add CHANGELOG.md
git commit -m "chore(version): ${next} [ci-skip]"
git tag "${next}"
